#include "stdafx.h"
#include <stdio.h>
#include <memory.h>
#include <windows.h>
#include "ioal_core.h"
#include "../common.h"
#include "../Socket.h"

#ifdef _TEST
class CTap
{
public:
	static void test();
};

namespace ioal
{
	ioal_context* ioal;
	void on_state_change()
	{
		printf("on_state_change: %u%%, %s, %s\n", 
			ioal_login_progress(ioal), 
			ioal_status_string(ioal), 
			ioal_error_string(ioal));
	}

	void test()
	{
		//ioal=ioal_create(PORT, "172.26.22.28");
		//ioal=ioal_create(PORT, "localhost");
		ioal=ioal_create(PORT, "192.168.10.210");
		ioal_on_state_change(ioal, &on_state_change);
		ioal_login(ioal);
		//ioal_login_async(ioal);	getchar();
		//ioal_login_async(ioal);	getchar();
		//ioal_login_async(ioal);	getchar();
		while (true) ::Sleep(1000);
	}
};

int main()
{
	//ISocket::test();
//	CTap::test();
	ioal::test();
	return 0;
}

#endif